﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Policy;
using System.Text;
using GooglePlaces.Queries;


namespace GooglePlaces
{
    public class PlaceSearchApi : BaseApi
    {        
        //params: location, radius
        public string NearbySearch(PlaceSearchQuery query)
        {
            this.BaseApiURL = "https://maps.googleapis.com/maps/api/place/nearbysearch/";
            
            this.Parameters = ComputeParameters(query);
            string result = MakeHttpRequestAndGetResponse(this.APIURL);
            return result;
        }

        public string TextSearch(PlaceSearchQuery query)
        {
            this.BaseApiURL = "https://maps.googleapis.com/maps/api/place/textsearch/";

            this.Parameters = ComputeParameters(query);
            var result = MakeHttpRequestAndGetResponse(this.APIURL);
            return result;
        }

        
        
    }
}
